<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ShopUserPasswrongs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        //创建登录输入密码错误记录表
        Schema::create('shop_user_passwrongs', function (Blueprint $table) {
          $table->increments('id');
          $table->unsignedInteger('user_id');
          $table->unsignedInteger('ipaddress')->comment('记录用户登录的ip地址');
          $table->timestamp('logintime')->comment('记录用户登录时间');
          $table->unsignedTinyInteger('pass_wrong_status')->comment('1:正确;2:错误');

          $table->foreign('user_id')
            ->references('id')->on('shop_home_users')
            ->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('shop_user_passwrongs');

    }
}
